get the current page id in wordpress

85

get the current page id in wordpress -

$page_id = get_queried_object_id();

target wordpress page id -

body { background-color: red; }

.page-id-1 body, .page-id-2 body , .page-id-3 body { 
    background-color: green!important; 
}

Comments

Submit
0 Comments